/**
 * @author: zzj
 * @date: 2020-03-12 10:32:33
 * @version: 1.0
 */
import Vue from 'vue'

Vue.directive('loading', {
  bind: function (el, binding) {
    if (binding.value) Vue.prototype.showLoading();
  },
  update: function (el, binding) {
    if (binding.value) {
      Vue.prototype.showLoading();
    } else {
      Vue.prototype.hideLoading();
    }
  },
  unbind: function () {
    Vue.prototype.hideLoading();
  }
});
